/*
 * 24cxx.h
 *
 *  Created on: Sep 30, 2022
 *      Author: 31866
 */

#ifndef INC_24CXX_H_
#define INC_24CXX_H_

#include "i2c.h"
#include "tim.h"
#include "stdio.h"
typedef enum
{
	false,
	true,
}bool;

#define AT24C01      127
#define AT24C02      255
#define AT24C04      511
#define AT24C08      1023
#define AT24C16      2047
#define AT24C32      4095
#define AT24C64      8191
#define AT24C128     16383
#define AT24C256     32767

#define EE_TYPE AT24C02  //STM32F103ZET6使用的是AT24C02

#define AT24C_DEV_WRITEADDR  0xA0  //设备地址
#define AT24C_DEV_READADDR   0xA1  //设备地址


uint8_t HAL_AT24CXX_ReadOneByte(uint16_t ReadAddr);
uint8_t HAL_AT24CXX_WriteOneByte(uint16_t WriteAddr,uint8_t WriteData);
void HAL_AT24CXX_WriteLenByte(uint16_t WriteAddr,uint8_t *pData,uint8_t dataLen);
void HAL_AT24CXX_ReadLenByte(uint16_t ReadAddr,uint8_t *pData,uint8_t dataLen);
bool HAL_AT24CXX_Check(void);

#endif /* INC_24CXX_H_ */
